import { useState,useContext } from 'preact/hooks'
import {AuthContext} from '@/contexts/authContext';

export function Test() {
  let [name,setName] = useState('boonook');
  let {loginOut} = useContext<any>(AuthContext);
  const onLoginOut=()=>{
    loginOut().then((res:any)=>{
     if(res){
        console.log('退出登陆成功！');
     }   
    }).catch((err:any)=>{
        console.log('退出登陆失败！');
    })
  }
  return (
    <>
        <div>123123</div>
        <h5>{name}</h5>
        <button onClick={()=>{
            onLoginOut()
        }}>退出</button>
    </>
  )
}
